<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link href="https://cdn.bootcss.com/twitter-bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.css">
    <script src="https://cdn.bootcss.com/jquery/3.2.0/jquery.min.js"></script>
    <script src="https://cdn.bootcss.com/twitter-bootstrap/4.1.3/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js"></script>
    <style>
        #videoModal {
            width: 900px;
            height: 900px;
            position: absolute;
            border: 1px solid #ccc;
            margin: 50px auto;
        }
    </style>
</head>

<body>
    <div class="container-fluid">
        <div class="sidebar"></div>
        <div class="content">
            <div class="row">
                <div class="col-md-6">
                    <div class="card">
                        <img class="card-img-top" src="http://img.jdzj.com/UserDocument/2017a/tmfhsc/Picture/20178418252.jpg"
                            data-video='http://222.73.61.236/6975F490600368108489DC47CC/03000A01005A995E882D3B6314626F43180547-F3E7-4A9D-A529-E8325105B987.mp4?ccode=0502&duration=332&expire=18000&psid=b45f3a6937cb7634403df5e30d4b47f6&ups_client_netip=73ab159a&ups_ts=1543419174&ups_userid=&utid=F9ReE7jOeVMCAd9HhCrMMWpn&vid=XMzQzNDk5MDEwMA&vkey=A95bab7e3299ee2c25b145b0ca7fca6a1&sp='>
                    </div>
                </div>
            </div>
        </div>
        <div id="videoModal"></div>
    </div>
    <script>
        let player = null;
        $(function () {
            $('.card-img-top').click((e) => {
                let video = $(this).data('video');
                let image = $(this).attr('src');
                if (!player) {
                    player = new DPlayer({
                        container: document.getElementById('videoModal'),
                        screenshot: true,
                        video: {
                            url: video,
                            pic: image,
                            thumbnails: image
                        }
                    })
                } else {
                    player.switchVideo({
                        url: video,
                        pic: image,
                        thumbnails: 'auto'
                    })
                }
            })
        })
    </script>
</body>


</html>